<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="/WEB-INF/tlds/nodes-faces.tld" prefix="n" %>

<f:subview id="searchActions">
    <f:loadBundle basename="offset.nodes.server.view.ApplicationResource" var="msg"/>

    <f:subview id="hidingSearchActions" rendered="#{LayoutBean.hidingActions}" >
        <div class="menu-container" style="float:left;width:16px;">

            <h:inputHidden value="#{SearchBean.key}"/>

            <h:graphicImage onclick="parent.toggleNavigationFrame()" value="#{NodesBean.imagePath}/end.png" alt="#{msg.versions}" title="#{msg.mainMenu}" style="cursor:pointer;"/>

            <h:panelGrid  styleClass="menu">

                <h:outputText rendered="#{NodesBean.appletSubstitution && SearchBean.XPathQuery}" escape="false" value='<span onclick="run(\'edit\')" class="commandLink">#{msg.dataActionsEdit}</span>'/>                
                <n:applet function="edit"
                          code="offset.nodes.client.dialog.xpath.view.EditXPathQueryApplet" codebase="#{NodesBean.contextPath}" jar="dialog.jar"
                          width="0" height="0">
                    <f:param name="service" value="#{NodesBean.dialogPath}"/>
                    <f:param name="base" value="#{NodesBean.repositoryPath}"/>
                    <f:param name="key" value="#{SearchBean.key}"/>
                    <f:param name="path" value="#{PathBean.path}"/>
                </n:applet>

                <h:outputText rendered="#{NodesBean.appletSubstitution && SearchBean.XPathQuery}" escape="false" value='<span onclick="run(\'saveAs\')" class="commandLink">#{msg.searchSaveAs}</span>'/>                
                <n:applet function="saveAs"
                          code="offset.nodes.client.dialog.xpath.view.SaveAsXPathQueryApplet" codebase="#{NodesBean.contextPath}" jar="dialog.jar"
                          width="0" height="0">
                    <f:param name="service" value="#{NodesBean.dialogPath}"/>
                    <f:param name="repository" value="#{NodesBean.repositoryPath}"/>
                </n:applet>

            </h:panelGrid>

        </div>
    </f:subview>

    <f:subview id="showingSearchActions" rendered="#{LayoutBean.showingActions}" >

        <div>

            <h:inputHidden value="#{SearchBean.key}"/>

            <h:panelGrid columns="1">

                <h:panelGroup>
                    <h:outputText rendered="#{NodesBean.appletSubstitution && SearchBean.XPathQuery}" escape="false" value='<span onclick="run(\'edit\')" class="commandLink">#{msg.dataActionsEdit}</span>'/>
                    <h:panelGroup id="edit" layout="block" style="display:inline"/>
                    <n:applet function="edit"
                              code="offset.nodes.client.dialog.xpath.view.EditXPathQueryApplet" codebase="#{NodesBean.contextPath}" jar="dialog.jar"
                              width="0" height="0">
                        <f:param name="service" value="#{NodesBean.dialogPath}"/>
                        <f:param name="base" value="#{NodesBean.repositoryPath}"/>
                        <f:param name="key" value="#{SearchBean.key}"/>
                        <f:param name="path" value="#{PathBean.path}"/>
                    </n:applet>

                </h:panelGroup>

                <h:panelGroup>
                    <h:outputText rendered="#{NodesBean.appletSubstitution && SearchBean.XPathQuery}" escape="false" value='<span onclick="run(\'saveAs\')" class="commandLink">#{msg.searchSaveAs}</span>'/>
                    <h:panelGroup id="saveAs" layout="block" style="display:inline"/>
                    <n:applet function="saveAs"
                              code="offset.nodes.client.dialog.xpath.view.SaveAsXPathQueryApplet" codebase="#{NodesBean.contextPath}" jar="dialog.jar"
                              width="0" height="0">
                        <f:param name="service" value="#{NodesBean.dialogPath}"/>
                        <f:param name="repository" value="#{NodesBean.repositoryPath}"/>
                    </n:applet>
                </h:panelGroup>

            </h:panelGrid>
        </div>

    </f:subview>
</f:subview>